//
// Created by wangjunjun on 2024/4/16.
//

#ifndef SUBCMD_H
#define SUBCMD_H
/*
 * @brief:订阅消息类型
 * ＠function:订阅语音接管类型
 * */
#include "subtokenover.hpp"
#include <lcm/lcm-cpp.hpp>
#include <iostream>
#include <memory>
#include <mutex>
class CSubCmd {

public:
    //设置单例模式获取资源数据
    static std::shared_ptr<CSubCmd> GetInStance();
    void Start();
    void HandleMessage(const lcm::ReceiveBuffer* rbuf, const std::string& channel, const CTokenOverType* msg);
private:
    CSubCmd();
    ~CSubCmd();
    void HandRecProc(void);
private:
    static std::shared_ptr<CSubCmd> m_Instance;
    static std::once_flag m_flag;

};


#endif //SUBCMD_H
